<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 实现一个myEvery方法达到内置every循环效果
        function myEvery(fn) {
            for (var i = 0; i < this.length; i++) {
                fn(this[i], i, this);
                if (!this[i]) {
                    return false;
                }
            }
            return true;
        }
        Array.prototype.myEvery = myEvery;
        var arr = [true, true, true];

        var lastres =arr.myEvery(function (item) {
        })
        console.log(lastres);
    </script>
</body>

</html>